package com.sun.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Author: Suncl
 * @Date: 2023/3/19 11:04
 */
public class MyInvocationHandler implements InvocationHandler {
    private Object target;

    public MyInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("MyInvocationHandler。。。。invoke");
        System.out.println("method---" + method.getName() + "-------");

        return method.invoke(target,args);
    }
}
